= new boolean[15];
for(int i =0; i < n; i++){
System.out.println(visited[s.charAt(i)]);
}
Please who has an explanation to why the snippet inside the loop run?
I thought we access element of array with index that is visited[1] or so but s.charAt(i) is returning character located at i.
Because for Strings java doesnt support [], so you have to use charAt method
Обсуждают сегодня