We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hi I figure it out how to do this in a straigth foward way with some convertions
publicstaticintfindDigits(intn){// Write your code hereStringn2=Integer.toString(n);ArrayList<Integer>nuevo=newArrayList<>();intcontador=0;for(charl:n2.toCharArray()){intx=Character.getNumericValue(l);nuevo.add(x);}for(intn3:nuevo){if(n3!=0&&n%n3==0)contador++;}System.out.println(nuevo);returncontador;}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find Digits
You are viewing a single comment's thread. Return to all comments →
Hi I figure it out how to do this in a straigth foward way with some convertions