|  | 
| 70 | 70 | {"id":"largest-square","title":"Largest Square","description":"Given a two dimensional matrix made up of **0**'s and **1**'s, write a method `largestSquare` to find the largest square containing all 1's and return its `area`. \n\nThe `area` is simply the sum of all integers enclosed in the square.\n\n### Example\n\n```\nInput Matrix : \n             \n  1101     xxxx    11xx\n  1101  => 11xx or 11xx\n  1111     11xx    xxxx\n\nOutput  : 4\n```","timeLimit":1,"memoryLimit":32,"level":3,"func":{"name":"largestSquare","returnStatement":{"type":"java.lang.Integer","comment":"Area of the largest square"},"parameters":[{"name":"matrix","type":"[[C","comment":"2D matrix of 0s and 1s"}]},"testCases":[{"input":[[["1","1","0","1"],["1","1","0","1"],["1","1","1","1"]]],"output":4},{"input":[[["1","1"],["1","1"]]],"output":4},{"input":[[["1","1","1"],["1","1","1"],["1","1","1"]]],"output":9},{"input":[[["1","0"],["0","1"]]],"output":1},{"input":[[["1","1","0","1","0"],["1","1","0","1","1"],["0","1","1","1","0"],["1","1","1","1","1"],["1","1","1","1","0"]]],"output":9},{"input":[[["0","0"],["0","0"]]],"output":0}]}, | 
| 71 | 71 | {"id":"longest-palindromic-substring","title":"Longest Palindromic Substring","description":"Given a `String`, write the method `longestPalSubstr` that finds and returns the longest substring which is also a `Palindrome`. \n\nTry and accomplish this in at most **O(n^2)** runtime.\n\n### Examples\n\n* `\"bccb\"` => `\"bccb\"`\n* `\"bccd\"` => `\"cc\"`\n* `\"bccc\"` => `\"ccc\"`","timeLimit":1,"memoryLimit":32,"level":3,"func":{"name":"longestPalSubstr","returnStatement":{"type":"java.lang.String","comment":"Longest substring which is also a Palindrome"},"parameters":[{"name":"str","type":"java.lang.String","comment":"input"}]},"testCases":[{"input":["bccb"],"output":"bccb"},{"input":["bccd"],"output":"cc"},{"input":["bccc"],"output":"ccc"},{"input":["AAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBAAAAAAAAAAAAAAACCCCCCCDDDAAAAAAAAAAAAAAAA"],"output":"AAAAAAAAAAAAAAABBBBBBBBBBBBBBAAAAAAAAAAAAAAA"},{"input":["A"],"output":"A"},{"input":["ABCD"],"output":"A"},{"input":["ABCDEFGHHGFEBA"],"output":"EFGHHGFE"}]}, | 
| 72 | 72 | {"id":"1-800-problem","title":"1-800-Problem","description":"Given a `String` that represents the digits pressed on a classic cell phone keypad - return all possible letter `combinations` that the numbers could represent in an `ArrayList` of `String`s.\n\nCheck out the keypad mapping below for reference.\n\n**Note:**\n* You can assume that the input String contains only numbers between 2 and 9\n* The `combinations` should be return in alphabetical order\n\nMapping:\n* 2 -> \"abc\"\n* 3 -> \"def\"\n* 4 -> \"ghi\"\n* 5 -> \"jkl\"\n* 6 -> \"mno\"\n* 7 -> \"pqrs\"\n* 8 -> \"tuv\"\n* 9 -> \"wxyz\"\n\n### Examples\n\n* `34` -> `[dg, dh, di, eg, eh, ei, fg, fh, fi]`","timeLimit":1,"memoryLimit":32,"level":2,"func":{"name":"getStringsFromNums","returnStatement":{"type":"java.util.ArrayList","comment":"Combinations","generic":"String"},"parameters":[{"name":"digits","type":"java.lang.String","comment":"digits pressed on a classic cell phone keypad"}]},"testCases":[{"input":["34"],"output":["dg","dh","di","eg","eh","ei","fg","fh","fi"]},{"input":["23"],"output":["ad","ae","af","bd","be","bf","cd","ce","cf"]},{"input":["232"],"output":["ada","adb","adc","aea","aeb","aec","afa","afb","afc","bda","bdb","bdc","bea","beb","bec","bfa","bfb","bfc","cda","cdb","cdc","cea","ceb","cec","cfa","cfb","cfc"]},{"input":["6"],"output":["m","n","o"]},{"input":["8"],"output":["t","u","v"]}]}, | 
| 73 |  | -{"id":"max-cont-sequence","title":"Maximum Contiguous Subsequence","description":"Given an array of integers consisting of both positive and negative numbers, write a method `maxContSequence` to find the contiguous subsequence that has the **maximum sum** among all `subsequences` in the array.\n\nYour method should return `res` array containing 3 integers in the following format:\n```\nres[0] = max sum\nres[1] = starting index of the subsequence\nres[2] = ending index of the subsequence\n```\n\n**Note**\n* In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example, the sequence `<A,B,D>` is a subsequence of `<A,B,C,D,E,F>`. They should not be confused with substring which is a refinement of subsequence.\n* you can check wikipedia for more details\n* for empty input, return -1\n\n### Examples\n\n* `[-1,-2,3,4,5]` -> `[12,2,4]`\n* `[1,2,3,-2,5]` -> `[9,0,4]`","timeLimit":1,"memoryLimit":32,"level":3,"func":{"name":"maxContSequence","returnStatement":{"type":"[I","comment":"Result containing 3 integers, max sum, starting and ending index of the subsequence"},"parameters":[{"name":"arr","type":"[I","comment":"array of integers"}]},"testCases":[{"input":[[-1,-2,3,4,5]],"output":[12,2,4]},{"input":[[1,2,3,-2,5]],"output":[9,0,4]},{"input":[[]],"output":[0,0,-1]},{"input":[[-1,30,-4,20,20,-11]],"output":[66,1,4]},{"input":[[1,2,3,4,5,6]],"output":[21,0,5]},{"input":[[-1,-2,-3,-4,-5,-6]],"output":[-1,0,0]}]}] | 
|  | 73 | +{"id":"max-cont-sequence","title":"Maximum Contiguous Subsequence","description":"Given an array of integers consisting of both positive and negative numbers, write a method `maxContSequence` to find the contiguous subsequence that has the **maximum sum** among all `subsequences` in the array.\n\nYour method should return `res` array containing 3 integers in the following format:\n```\nres[0] = max sum\nres[1] = starting index of the subsequence\nres[2] = ending index of the subsequence\n```\n\n**Note**\n* In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example, the sequence `<A,B,D>` is a subsequence of `<A,B,C,D,E,F>`. They should not be confused with substring which is a refinement of subsequence.\n* you can check wikipedia for more details\n* for empty input, return `[0,0,-1]`\n\n### Examples\n\n* `[-1,-2,3,4,5]` -> `[12,2,4]`\n* `[1,2,3,-2,5]` -> `[9,0,4]`","timeLimit":1,"memoryLimit":32,"level":3,"func":{"name":"maxContSequence","returnStatement":{"type":"[I","comment":"Result containing 3 integers, max sum, starting and ending index of the subsequence"},"parameters":[{"name":"arr","type":"[I","comment":"array of integers"}]},"testCases":[{"input":[[-1,-2,3,4,5]],"output":[12,2,4]},{"input":[[1,2,3,-2,5]],"output":[9,0,4]},{"input":[[]],"output":[0,0,-1]},{"input":[[-1,30,-4,20,20,-11]],"output":[66,1,4]},{"input":[[1,2,3,4,5,6]],"output":[21,0,5]},{"input":[[-1,-2,-3,-4,-5,-6]],"output":[-1,0,0]}]}] | 
0 commit comments