Hi. I’m quite new to CP. I use Java.
I often notice in contests that we are given a String of space separated integers as inputs, which we have to convert into an integer array to perform operations on them. What I do is split the String (String a = str.split(" ") to convert it into a String array and then use for loop to convert it into an integer array.
What I mean to ask is whether there is a better way of doing so, i.e., converting it into an integer array using less number of code steps, i.e., whether there is any in-built java function which may help me.