Skip to content

Commit

Permalink
- fix for problem
Browse files Browse the repository at this point in the history
- happy numbers problem description fix
  • Loading branch information
spolnik committed Feb 11, 2017
1 parent c317c96 commit 60e01ff
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified ProblemsStore/00000000000.xd
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/versioning.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//noinspection GroovyAssignabilityCheck
version = new ProjectVersion(
'1', '0', '29', System.env.TRAVIS_BUILD_NUMBER
'1', '0', '30', System.env.TRAVIS_BUILD_NUMBER
)

println "Version number: " + version
Expand Down
2 changes: 1 addition & 1 deletion problems.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{"id":"count-paths","title":"Count Paths","description":"You're given a game board that has m x n squares on it, represented by an m x n array. Write a method `countPaths` that takes in m and n and returns the number of possible paths from the top left corner to the bottom right corner. Only down and right directions of movement are permitted.\r\n\r\n### Examples\r\n\r\n``` \r\n countPaths(m = 2, n = 2) => 2 \r\n \r\n as on the following 2x2 Board, the two paths are A->C->D and A->B->D \r\n \r\n A B \r\n C D \r\n```","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"countPaths","returnStatement":{"type":"java.lang.Integer","comment":" Number of paths"},"parameters":[{"name":"m","type":"java.lang.Integer","comment":"Number of rows"},{"name":"n","type":"java.lang.Integer","comment":"Number of columns"}]},"testCases":[{"input":[1,1],"output":1},{"input":[7,15],"output":38760},{"input":[3,5],"output":15},{"input":[10,12],"output":167960},{"input":[15,16],"output":77558760},{"input":[5,3],"output":15},{"input":[4,1],"output":1},{"input":[2,2],"output":2},{"input":[18,17],"output":1166803110},{"input":[12,6],"output":4368},{"input":[8,10],"output":11440},{"input":[0,0],"output":0},{"input":[1,0],"output":0},{"input":[0,1],"output":0}]},
{"id":"delete-at-middle","title":"Delete Node at Middle","description":"Given a singly linked list, write a method `deleteAtMiddle` to delete the node at a given position (starting from 1 as the head position) and return the head of the list. Do nothing if the input position is out of range.\r\n\r\n### Examples\r\n\r\n* `1->2->3->4->5->6, 3` -> `1->2->4->5->6`","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"deleteAtMiddle","returnStatement":{"type":"com.jalgoarena.type.ListNode","comment":" New Linked List with removed node at given position"},"parameters":[{"name":"head","type":"com.jalgoarena.type.ListNode","comment":"Linked List head"},{"name":"position","type":"java.lang.Integer","comment":"Position of node to be removed"}]},"testCases":[{"input":[[1,2,3,4,5,6],3],"output":[1,2,4,5,6]},{"input":[[1,2,3,4,5,6],1],"output":[2,3,4,5,6]},{"input":[[1,2,3,4,5,6],6],"output":[1,2,3,4,5]},{"input":[[1],3],"output":[1]},{"input":[[1],1],"output":null},{"input":[null,1],"output":null}]},
{"id":"sum-binary-tree","title":"Sum of a binary tree","description":"Given a binary tree, write a method `sum` to find and return the sum of all elements. For an empty tree return 0.\r\n\r\n### Example\r\n\r\n ```\r\n 1\r\n / \\\r\n 2 3 ==> sum = 28\r\n / \\ / \\\r\n 4 5 6 7 \r\n```","timeLimit":1,"memoryLimit":32,"level":1,"func":{"name":"sum","returnStatement":{"type":"java.lang.Integer","comment":" Sum of all binary tree elements"},"parameters":[{"name":"root","type":"com.jalgoarena.type.TreeNode","comment":"Root of binary tree"}]},"testCases":[{"input":[{"data":1,"left":{"data":2,"left":{"data":4},"right":{"data":5}},"right":{"data":3,"left":{"data":6},"right":{"data":7}}}],"output":28},{"input":[{"data":1,"left":{"data":2,"left":{"data":4},"right":{"data":-5}},"right":{"data":3,"left":{"data":6},"right":{"data":-7}}}],"output":4},{"input":[{"data":1,"left":{"data":2,"left":{"data":4}},"right":{"data":3,"right":{"data":7,"left":{"data":6}}}}],"output":23},{"input":[{"data":1}],"output":1},{"input":[null],"output":0}]},
{"id":"happy-numbers","title":"Happy Numbers","description":"Write a method `isHappyNumber` to determine whether a positive number is `Happy`. A number is Happy (Yes, it is a thing!) if it follows a sequence that ends in 1 after following the steps given below:\r\n\r\bBeginning with the number itself, replace it by the sum of the squares of its digits until either the number becomes 1 or loops endlessly in a cycle that does not include 1. For instance, 19 is a happy number. Sequence: \r\n 1^2^ + 9^2^ = 82 \r\n 8^2^ + 2^2^ = 68 \r\n 6^2^ + 8^2^ = 100 \r\n 1^2^ + 0^2^ + 0^2^ = 1. \r\n\r\n### Examples\r\n\r\n* `19` -> `true`","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"isHappyNumber","returnStatement":{"type":"java.lang.Boolean","comment":" Is happy number"},"parameters":[{"name":"head","type":"java.lang.Integer","comment":"Input number"}]},"testCases":[{"input":[19],"output":true},{"input":[28],"output":true},{"input":[68],"output":true},{"input":[12],"output":false},{"input":[100],"output":true},{"input":[12352],"output":false},{"input":[0],"output":false}]},
{"id":"happy-numbers","title":"Happy Numbers","description":"Write a method `isHappyNumber` to determine whether a positive number is `Happy`. A number is Happy (Yes, it is a thing!) if it follows a sequence that ends in 1 after following the steps given below:\n\n\bBeginning with the number itself, replace it by the sum of the squares of its digits until either the number becomes 1 or loops endlessly in a cycle that does not include 1. For instance, 19 is a happy number. Sequence: \n * 1^2^ + 9^2^ = 82 \n* 8^2^ + 2^2^ = 68 \n* 6^2^ + 8^2^ = 100 \n* 1^2^ + 0^2^ + 0^2^ = 1. \n\n### Examples\n\n* `19` -> `true`","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"isHappyNumber","returnStatement":{"type":"java.lang.Boolean","comment":" Is happy number"},"parameters":[{"name":"head","type":"java.lang.Integer","comment":"Input number"}]},"testCases":[{"input":[19],"output":true},{"input":[28],"output":true},{"input":[68],"output":true},{"input":[12],"output":false},{"input":[100],"output":true},{"input":[12352],"output":false},{"input":[0],"output":false}]},
{"id":"first-non-repeated-char","title":"First Non Repeated Character","description":"Write a method `findFirstNonRepeatedChar` that finds the first non-duplicate character in a string. Return null if no unique character is found.\r\n\r\n### Example\r\n\r\n* `'asdsdakz` -> `'k'`","timeLimit":1,"memoryLimit":32,"level":1,"func":{"name":"findFirstNonRepeatedChar","returnStatement":{"type":"java.lang.String","comment":" First non-duplicate character or null if absent"},"parameters":[{"name":"str","type":"java.lang.String","comment":"Input string"}]},"testCases":[{"input":["asdsdakz"],"output":"k"},{"input":["asdsda"],"output":null},{"input":["asd"],"output":"a"},{"input":[""],"output":null},{"input":[null],"output":null}]},
{"id":"inorder-traversal","title":"Inorder Traversal","description":"Given a binary tree, Write a method `inorderTraversal` to traverse the tree in the inorder manner. Return array of elements visited in inorder format.\r\n\r\n### Example\r\n\r\n ```\r\n 1\r\n / \\\r\n 2 3 ==> 4251637\r\n / \\ / \\\r\n 4 5 6 7 \r\n```","timeLimit":1,"memoryLimit":32,"level":1,"func":{"name":"inorderTraversal","returnStatement":{"type":"[I","comment":" Inordered array of binary tree elements"},"parameters":[{"name":"root","type":"com.jalgoarena.type.TreeNode","comment":"Root of binary tree"}]},"testCases":[{"input":[{"data":1,"left":{"data":2,"left":{"data":4},"right":{"data":5}},"right":{"data":3,"left":{"data":6},"right":{"data":7}}}],"output":[4,2,5,1,6,3,7]},{"input":[{"data":1,"left":{"data":2,"left":{"data":4}},"right":{"data":3,"right":{"data":7}}}],"output":[4,2,1,3,7]},{"input":[{"data":1}],"output":[1]},{"input":[null],"output":[]}]},
{"id":"preorder-traversal","title":"Preorder Traversal","description":"Given a binary tree, Write a method `preorderTraversal` to traverse the tree in the preorder manner. Return array of elements visited in preorder format.\r\n\r\n### Example\r\n\r\n ```\r\n 1\r\n / \\\r\n 2 3 ==> 1245367\r\n / \\ / \\\r\n 4 5 6 7 \r\n```","timeLimit":1,"memoryLimit":32,"level":1,"func":{"name":"preorderTraversal","returnStatement":{"type":"[I","comment":" Preordered array of binary tree elements"},"parameters":[{"name":"root","type":"com.jalgoarena.type.TreeNode","comment":"Root of binary tree"}]},"testCases":[{"input":[{"data":1,"left":{"data":2,"left":{"data":4},"right":{"data":5}},"right":{"data":3,"left":{"data":6},"right":{"data":7}}}],"output":[1,2,4,5,3,6,7]},{"input":[{"data":1,"left":{"data":2,"left":{"data":4}},"right":{"data":3,"right":{"data":7}}}],"output":[1,2,4,3,7]},{"input":[{"data":1}],"output":[1]},{"input":[null],"output":[]}]},
Expand Down

0 comments on commit 60e01ff

Please sign in to comment.