Id like to implement it with O(n) space solution since there is not restriction for this but i cant import lists.Could you please add the restriction to the problem description
1 Like
Hello @Rami_Mankevich,
Yes certainly! You can devise your solutions as there’s no restriction on proposing more than 1 correct solution.
Moreover, if you wish to write a solution using lists, simply type in the import statement for that in the coding window, for example, import java.util.ArrayList;
, etc.
Please feel free to share more feedback and suggestions; we’d be happy to help. Thanks!
Happy learning!