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.
Beautiful Days at the Movies
Beautiful Days at the Movies
Sort by
recency
|
1686 Discussions
|
Please Login in order to post a comment
Swift: If we use a revert string, it will make the test cases timeout.
python 3
public static int beautifulDays(int i, int j, int k) { // Write your code here int count=0; for(int z=i;z<=j;z++){ int temp=z; String rev=Integer.toString(temp); StringBuilder str=new StringBuilder(rev); str.reverse(); String arev=str.toString(); int rnum=Integer.parseInt(arev); int res=Math.abs(rnum-temp); if(res%k==0){ count++; }
}
Javascript
Mi solucion Java 8: