MCPcopy Create free account
hub / github.com/Jiasm/notebook / nextBigger

Function nextBigger

javascript/nextbigger.js:14–51  ·  view source on GitHub ↗

* 0. 将传入的参数转换为一个数组 * 1. 取出数组中的 最后两位...最后三位...最后四位——以此类推,并将该范围内的数字倒序排列,直到找到比原数字在这个区间内大的数字,如果到最后都没找到,则返回-1 * 2. 取出该范围在原字符串中的下标对应的值(cursor)取出 * 3. 取出原数字在该下标前的数字(before) * 4. 取出原数字在该下标后的数字(after),组成一个数组,并按照正序排列 * 5. 取出after中大于下标值的数字中的最小的一个(newCursor) * 6. 将after和cursor合并,并按照正序排列(after) * 7. 将befo

(number)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

nextbigger.jsFile · 0.85

Calls 2

sortByDESCFunction · 0.85
sortByASCFunction · 0.85

Tested by

no test coverage detected