theash2473
JCHJava Community | Help. Code. Learn.
•Created by theash2473 on 2/9/2025 in #java-help
github repo deleted. Now cloning local to a new remote repo
My current git repo has all the commits and branches and whatever that was done in the repo. Although the remote repo somehow got deleted long back. I now want to push the current repo to a new remote as it is. I created this repo to learn git so I made sure that all the commits and branches are also present in the remote back then. Now I wanna do it again.
I am trying to understand reflogs of the repo so that I can compare what will go and what will not. Here are the reflogs below. I am stuck at the point that in the 3rd line, there's a branch name mentioned for the commit but only for the remote and not local branch. Can anyone clarify why is that?
If you could connect with me and see it live. It would help more in this case.
73 replies
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