wisdompeak / LeetCode

This repository contains the solutions and explanations to the algorithm problems on LeetCode. Only medium or above are included. All are written in C++/Python and implemented by myself. The problems attempted multiple times are labelled with hyperlinks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1017.Convert-to-Base--2,少了一个负号

mingyEx opened this issue · comments

commented

比如说5/(-3),结果商是-1,余数是-2.这个余数因为是负数,是无法用来作为进制转换结果的。
来自这里
本机测试5 % (-3)的输出为2,这里是否想表达-5/-3来得到-2?

确实如此。这个题解写的比较久了都没人仔细读过,现在看来确实感觉胡言乱语不知所云。

commented

个人习惯是先看文字版题解,遇到无法理解的部分才看视频,所以可能您的视频提到了但是文字版没有。
以后遇到类似的笔误我可以直接pr吗?

嗯,小笔误可以PR。大问题就ping我重写一下。谢谢