Answer the question
In order to leave comments, you need to log in
How to get all possible combinations of shuffling the digits of a number?
There is, for example, the number 941.
At the output, you need to get: 941, 914, 491, 419, 149, 194.
Judging by the materials in other intersecting topics on the Internet, it is necessary to use recursion here, but how to apply it, I still have an option in my head is not coming.
Answer the question
In order to leave comments, you need to log in
function* permutatins(s) {
if (s.length > 1)
for (let i = 0; i < s.length; i++)
for (let t of permutatins(s.slice(0, i) + s.slice(i + 1)))
yield s.charAt(i) + t;
else yield s;
}
for (let s of permutatins('941'))
console.log(s);
You make your own WebViewClient, override shouldOverrideUrlLoading and onLoadResource in it.
well, you register it in webview through setWebViewClient.
in onLoadResource you open a new activity.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question