theash2473
JCHJava Community | Help. Code. Learn.
•Created by theash2473 on 11/15/2024 in #java-help
Adding character/s to a string has two different variations.
If you add two characters to a string you get an int as an output but when you add one character it works.
Please explain. Here is an example with output for reference.
Output-:
182eeksforGeeks
[eeksforGeeks
14 replies
JCHJava Community | Help. Code. Learn.
•Created by theash2473 on 10/27/2024 in #java-help
I am getting TLE in Leetcode on question 29. Please help me optimize.
I am using the most efficient code that I could understand. Please suggest how to optimize it for the test case where the dividend is int_max and divisor is -1.
12 replies
JCHJava Community | Help. Code. Learn.
•Created by theash2473 on 10/18/2024 in #java-help
In the bitwise compliment operator there is confusion. Please help if you can.
For the 2’s complement, if we take 8 bits for a binary representation,
in the case of decimal 200, binary is 11001000
2’s complement is also 11001000
In the procedure to calculate mentioned in the link https://www.rit.edu/academicsuccesscenter/sites/rit.edu.academicsuccesscenter/files/documents/math-handouts/DM3_TwosComplement_BP_9_22_14.pdf, it should be 00111000
The confusion must be because of the 8th bit being a 1.
17 replies