We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b4b54c commit e311003Copy full SHA for e311003
src/main/java/com/thealgorithms/maths/UniformNumbers.java
@@ -1,6 +1,6 @@
1
package com.thealgorithms.maths;
2
3
-public class UniformNumbers {
+public final class UniformNumbers {
4
5
// Private constructor to prevent instantiation of the utility class
6
private UniformNumbers() {
@@ -9,7 +9,7 @@ private UniformNumbers() {
9
10
public static int uniformNumbers(int num) {
11
String numStr = Integer.toString(num);
12
- int uniformCount = (numStr.length() - 1) * 9; // Count for digits less than current length
+ int uniformCount = (numStr.length() - 1) * 9;
13
int finalUniform = Integer.parseInt(String.valueOf(numStr.charAt(0)).repeat(numStr.length()));
14
15
if (finalUniform <= num) {
0 commit comments