String Window problem

https://ide.geeksforgeeks.org/3vjF4Ke9Gw---2 out of 9 test cases are not passing and also output for sample input is correct. What i m doing wrong, what are the errors in the code

@AbhishekAhlawat1102,

https://ide.codingblocks.com/s/300487 corrected code.

Changes:

  1. Use nextLine instead of next for str2. (This was causing the error)

Some more good things to keep in mind:

  1. Use new int[256] to count chars instead of 128.
  2. Use:
				if (res.length() == 0 || minLen > right - left + 1) {

I added the condition res.length() == 0