Checking whether two numbers are permutation of each other?

前端 未结 7 2153
借酒劲吻你
借酒劲吻你 2021-02-15 22:44

Given two numbers a, b such that 1 <= a , b <= 10000000000 (10^10). My problem is to check whether the digits in them are permutation of each other or not. What is the fas

7条回答
  •  迷失自我
    2021-02-15 23:41

    Is it homework?

    Calculate number of appearances of each digit and compare them, if they are same then one number can be converted to other using permutation.

提交回复
热议问题