Hi Fisher, the problem is what if you can't use this floorKey API ? Then what would you do ?
@fkslfk3 жыл бұрын
I guess we could switch to the approach 1 which is using the binary search
@caminante42223 жыл бұрын
You should have used binary search for languages with no tree map
@mannana85503 жыл бұрын
F'ed this up on Amazon SDE II :/
@pavanpandya36714 ай бұрын
java.lang.NullPointerException: Cannot invoke "java.util.TreeMap.floorKey(Object)" because "" is null at line 19, TimeMap.get at line 71, __Driver__.__helperSelectMethod__ at line 91, __Driver__.__helper__ at line 112, __Driver__.main Can you help me resolve this ?
@LongNguyenThanhLe19 күн бұрын
add this line at the beginning of the get method: if(!map.containsKey(key)) return "";