http://ideone.com/cfqTA0 Could anyone help me to fix this error. java.lang.NullPointerException at Main.Solve(Main.java:18) at Main.Run(Main.java:57) at Main.main(Main.java:12) I dont know why this code have this errors. It running normal and give correct answer on my computer, but when i submited on timus, it is non zero error. This problems in acm.timus.ru is 1297. Sorry for my bad english. Anyway, thanks you for reading.








But you submitted it at IdeOne without input data, so input string
sis null and yields NPE on gettinglength.If you input something (from the sample of Timus, for example) it works:
http://ideone.com/Tgi3fg
Ah, my bad. Thanks you so much.