Skip to content

added solution#165

Open
Vosker wants to merge 4 commits into
mate-academy:masterfrom
Vosker:hw_1.3
Open

added solution#165
Vosker wants to merge 4 commits into
mate-academy:masterfrom
Vosker:hw_1.3

Conversation

@Vosker

@Vosker Vosker commented Jul 27, 2020

Copy link
Copy Markdown

No description provided.


StringBuilder binaryString = new StringBuilder();
while (value > 0) {
binaryString.insert(0, ((value % 2) == 0 ? "0" : "1"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to remove ternary operator on this line and see what happens, it's not needed here, you can pass value from % 2 directly

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants