Skip to content

Latest commit

 

History

History
15 lines (15 loc) · 346 Bytes

File metadata and controls

15 lines (15 loc) · 346 Bytes

class Solution { // Complete the function // n: Input n // Return True if the given number is a lucky number else return False public static boolean isLucky(int n) { // Your code here for(int i=2; i<=n; i++){ if(n%i==0) return false; n = n - n/i; } return true; } }