Possible second problem: "Android Unlock PIN", where you can enter strings of digits, e.g., "938817". Let's assume someone tries a smudge attack, i.e., look at smudge on your screen to see which digits you used (but can't see how often each was used). Suggestion for the problem: Write a function numberOfPins(int totalDigits, int differentDigits) that returns how many different PINs there are of length totalDigits and using differentDigits different digits.
numberOfPins(9, 9) = 362880
numberOfPins(9, 7) = 2328480
(These btw show that if you're going to use length 9, you might better not use all nine different digits but only use seven different ones.)