algorithm to find a number in which product of number of 4 & 7 is maximum in given range

后端 未结 2 1593
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-06 14:25

I am stuck in a question in which lower bound L and Upper bound U is given.
Now suppose in the decimal representation of integer X

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-06 15:20

    It seems you have the algorithm thought out already. Just break it down piece by piece and solve each part. I usually write something like you did there with comments and then break those down until they are at a reasonable bite size to write code for.

    When you have it working, if needed, you can optimize it.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题