You need to sign in to do that
Don't have an account?
Vijay Nagarathinam
calculate permutation combination
Hi All,
I want to implement one logic like below.
Number: 345678987656733
If the user giving the input as 898765. I want to check the value is matched with the above value or not based on the below format.
The given input length is 6, It should check 6 numbers.
For example:
Combination Result
345678 != 898765
456789 != 898765
567898 != 898765
678987 != 898765
789876 != 898765
898765 = 898765 (Matched) Similarly it will check the remaining combination and return the result.
I want to implement one logic like below.
Number: 345678987656733
If the user giving the input as 898765. I want to check the value is matched with the above value or not based on the below format.
The given input length is 6, It should check 6 numbers.
For example:
Combination Result
345678 != 898765
456789 != 898765
567898 != 898765
678987 != 898765
789876 != 898765
898765 = 898765 (Matched) Similarly it will check the remaining combination and return the result.
String strNumber = '345678987656733';
String input = String.valueOf(input);
if(strNumber.conatins(input)){
//your logic
}