Sunday, April 16, 2023

solving hackerrank Queries with Fixed Length

 first solution is

public static List<Integer> solve(List<Integer> arr, List<Integer> queries) {
List result = new ArrayList();
queries.forEach(k -> {
List<List<Integer>> partitionedList = new ArrayList<>();
for (int s = 0; s <= arr.size() - k; s++) {
partitionedList.add(arr.subList(s, s+k));
List<Integer> maxes = -> Collections.max(m)).collect(toList());
return result;
which is working fine but some is getting timeouts
now optimizations. 

No comments:

diablo immortal

 strangely I start liking diablo immortal in mobile, and now decided to install in windows :)