Skip to content

Commit e34d52f

Browse files
committed
- problem fixes
- add missing note to STOI problem
1 parent 518f4d7 commit e34d52f

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

ProblemsStore/00000000000.xd

96 Bytes
Binary file not shown.

gradle/versioning.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//noinspection GroovyAssignabilityCheck
22
version = new ProjectVersion(
3-
'1', '0', '17', System.env.TRAVIS_BUILD_NUMBER
3+
'1', '0', '18', System.env.TRAVIS_BUILD_NUMBER
44
)
55

66
println "Version number: " + version

problems.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{"id":"horizontal-flip","title":"Horizontal Flip","description":"Given an m x n 2D image matrix where each integer represents a pixel, write a method `flipHorizontalAxis` to flip it in-place along its horizontal axis.\r\n\r\n### Examples\r\n\r\n```\r\n[[1, 0],\r\n [0, 1]]\r\n->\r\n[[0, 1],\r\n [1, 0]]\r\n```","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"flipHorizontalAxis","returnStatement":{"type":"void","comment":"Operation in-place"},"parameters":[{"name":"matrix","type":"[[I","comment":"Image matrix to flip"}]},"testCases":[{"input":[[[1,0],[0,1]]],"output":[[0,1],[1,0]]},{"input":[[[0]]],"output":[[0]]},{"input":[[[1,0,1],[1,1,0],[0,1,1]]],"output":[[0,1,1],[1,1,0],[1,0,1]]}]},
2525
{"id":"binary-search","title":"Binary Search","description":"Write a method `binarySearch` that searches an array of integers for a given integer using the Binary Search Algorithm. If the input integer is found in the array - return index of that item. Otherwise, return -1.\r\n\r\n**Note**: You may assume that the given array of integers is already sorted in ascending order.\r\n\r\n### Example\r\n\r\n* `[2,5,7,11,15], 11` -> `3`","timeLimit":1,"memoryLimit":32,"level":1,"func":{"name":"binarySearch","returnStatement":{"type":"java.lang.Integer","comment":" Index of element if found or -1 if absent"},"parameters":[{"name":"arr","type":"[I","comment":"An array of Integers"},{"name":"n","type":"java.lang.Integer","comment":"element to find"}]},"testCases":[{"input":[[2,5,7,11,15],11],"output":3},{"input":[[2,5,7,11,15],15],"output":4},{"input":[[2,5,7,11,15],13],"output":-1},{"input":[[2],13],"output":-1},{"input":[[2],2],"output":0},{"input":[[],5],"output":-1},{"input":[[1,2,2,3],2],"output":1}]},
2626
{"id":"one-away","title":"One Away","description":"There are three types of edits that can be performed on strings: \r\n* insert a character\r\n* remove a character\r\n* replace a character. \r\n\r\nGiven two strings, write a method `oneEditAway` to check if they are one edit (or zero edits) away.\r\n\r\n### Examples\r\n\r\n* `\"pale\", \"ple\"` -> `true`","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"oneEditAway","returnStatement":{"type":"java.lang.Boolean","comment":" Is first string one or zero edits away from the second?"},"parameters":[{"name":"first","type":"java.lang.String","comment":"first string"},{"name":"second","type":"java.lang.String","comment":"second string"}]},"testCases":[{"input":["pale","ple"],"output":true},{"input":["pales","pale"],"output":true},{"input":["pale","bale"],"output":true},{"input":["pale","bake"],"output":false},{"input":["pale","bae"],"output":false},{"input":["bae","pale"],"output":false},{"input":["p",""],"output":true},{"input":["","p"],"output":true},{"input":["","pa"],"output":false},{"input":["Julia","juliA"],"output":false}]},
27-
{"id":"stoi","title":"String to Integer (stoi)","description":"Implement method `stoi` to convert a string to an integer.\n\n**Hint**: Carefully consider all possible input cases. If you want a challenge.\n\n**Notes**: \n* It is intended for this problem to be specified vaguely (ie, no given input specs). You are responsible to gather all the input requirements up front.\n* You cannot use `Integer.parseInt` or any other Java framework method - you have to implement it by yourself\n\n### Examples\n\n* `\"1\"` -> `1`","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"stoi","returnStatement":{"type":"java.lang.Integer","comment":"An integer"},"parameters":[{"name":"str","type":"java.lang.String","comment":"A string"}]},"testCases":[{"input":[""],"output":0},{"input":["1"],"output":1},{"input":["+1"],"output":1},{"input":["-1"],"output":-1},{"input":["123"],"output":123},{"input":["-123"],"output":-123},{"input":["+-2"],"output":0},{"input":["010"],"output":10}]},
27+
{"id":"stoi","title":"String to Integer (stoi)","description":"Implement method `stoi` to convert a string to an integer.\n\n**Hint**: Carefully consider all possible input cases. If you want a challenge.\n\n**Notes**: \n* It is intended for this problem to be specified vaguely (ie, no given input specs). You are responsible to gather all the input requirements up front\n* For incorrect input, return 0\n* You cannot use `Integer.parseInt` or any other Java framework method - you have to implement it by yourself\n\n### Examples\n\n* `\"1\"` -> `1`\n* `\"abc\"` -> `0`","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"stoi","returnStatement":{"type":"java.lang.Integer","comment":"An integer"},"parameters":[{"name":"str","type":"java.lang.String","comment":"A string"}]},"testCases":[{"input":[""],"output":0},{"input":["1"],"output":1},{"input":["+1"],"output":1},{"input":["-1"],"output":-1},{"input":["123"],"output":123},{"input":["-123"],"output":-123},{"input":["+-2"],"output":0},{"input":["010"],"output":10}]},
2828
{"id":"validate-bst","title":"BST Validation","description":"Given a binary tree, write a method `validateBST` to determine if it is a Binary Search Tree.\r\n\r\n### Example\r\n\r\n ``` \r\n 20 \r\n / \\ \r\n 15 30 \r\n / \\ \r\n14 18 \r\n \r\noutput ==> true\r\n\r\n 20\r\n / \\ \r\n 30 15 \r\n / \\ \r\n14 18 \r\n \r\noutput ==> false \r\n\r\n```","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"validateBST","returnStatement":{"type":"java.lang.Boolean","comment":" Is a binary search tree"},"parameters":[{"name":"root","type":"com.jalgoarena.type.TreeNode","comment":"Root of binary tree"}]},"testCases":[{"input":[{"data":5,"left":{"data":3,"left":{"data":2},"right":{"data":4}},"right":{"data":8,"left":{"data":6},"right":{"data":9}}}],"output":true},{"input":[{"data":1,"left":{"data":2,"left":{"data":4},"right":{"data":5}},"right":{"data":3,"left":{"data":10},"right":{"data":7}}}],"output":false},{"input":[{"data":1,"left":{"data":2,"left":{"data":4}},"right":{"data":3,"right":{"data":7,"left":{"data":6}}}}],"output":false},{"input":[{"data":1,"left":{"data":2,"left":{"data":4}},"right":{"data":3,"right":{"data":7,"left":{"data":40}}}}],"output":false},{"input":[{"data":20,"left":{"data":15,"left":{"data":10},"right":{"data":30}},"right":{"data":40}}],"output":false},{"input":[{"data":20,"left":{"data":15,"left":{"data":10},"right":{"data":16}},"right":{"data":40}}],"output":true},{"input":[{"data":1}],"output":true},{"input":[null],"output":true}]},
2929
{"id":"palindrome-perm","title":"Palindrome Permutations","description":"Given a string, write a method `isPermutationOfPalindrome` to check if it is a permutation of a palindrome. \r\n\r\nThe palindrome does not need to be limited to just dictionary words (skip non-letter characters). Your solution should be case insensitive.\r\n\r\n### Examples\r\n\r\n* `\"Tact Coa\"` -> `true` (permutations: \"taco cat\", \"acto tca\", etc.)","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"isPermutationOfPalindrome","returnStatement":{"type":"java.lang.Boolean","comment":" Indicate if string is a permutation of palindrome"},"parameters":[{"name":"phrase","type":"java.lang.String","comment":"string to be checked if any permutation is palindrome"}]},"testCases":[{"input":["abcabcd"],"output":true},{"input":["a"],"output":true},{"input":["Aa"],"output":true},{"input":[""],"output":false},{"input":["cxzwcxzwcxzwcxzwa"],"output":true},{"input":["cxzwcxzwcxzwcxzwab"],"output":false},{"input":["Tact Coa"],"output":true},{"input":["Tact Coa&"],"output":true}]},
3030
{"id":"delete-tail-node","title":"Delete List Tail Node","description":"Given a singly linked list, write a method `deleteAtTail` to delete its last node and return the head.\r\n\r\n### Examples\r\n\r\n* `1->2->3->4->5->6` -> `1->2->3->4->5`","timeLimit":1,"memoryLimit":32,"level":1,"func":{"name":"deleteAtTail","returnStatement":{"type":"com.jalgoarena.type.ListNode","comment":" Initial linked list with removed tail"},"parameters":[{"name":"head","type":"com.jalgoarena.type.ListNode","comment":"Linked List head"}]},"testCases":[{"input":[[1,2,3,4,5,6]],"output":[1,2,3,4,5]},{"input":[[1]],"output":[]},{"input":[[]],"output":[]},{"input":[[5,3]],"output":[5]}]},

0 commit comments

Comments
 (0)