2022.01.16 18:50 rocksnotstars What the foooooooook is wrong with my code?
I started leetcoding for the first time. And it's been 2 days that I am stuck on the first problem I began with. Please bear with me and help me out.
I am doing the Two Sum problem.
This is my code that I wrote on leetcode
The Problem: My code is producing the correct solution for the array input [2,7,11,15] and target = 9. But it is producing wrong answer for array input [3,2,4] and target = 6.
My approach to the solution is -
1) sort the input array (I sorted it in ascending order)
2) Put the first pointer on the first (smallest) element in the array and the second pointer on the last (largest) element in the array.
Add both these elements and save it in a variable called sum. Then we have 3 cases.
a) If sum == target . Then yay!
b) If sum < target then make the first pointer point to the next element in the array.
Reason: we need to increase the sum to reach the target.
c) If sum > target then make the 2nd pointer point to the previous element in the array.
I tried running my code (minus some slight modifications that I made for leetcode)on my own laptop's terminal. And in all cases it produced the correct output . So I feel pretty confident that my approach to the problem is correct.
But what the fooooooooooook is wrong with my code??
submitted by rocksnotstars to C_Programming [link] [comments]
2022.01.16 18:50 Real_Public Test another
|submitted by Real_Public to YellowbrickInvesting [link] [comments]|
2022.01.16 18:50 IwasawasBeauty Why though.
|submitted by IwasawasBeauty to Cringetopia [link] [comments]|
2022.01.16 18:50 NoxaNoxa What are these? What are they doing? Found near Olympic National Park, Washington state
|submitted by NoxaNoxa to woahdude [link] [comments]|
2022.01.16 18:50 TenOunceCan SALE (ends Feb 1) Pikes 1-302 = $2. Chicken Bin = $3. Entire Pikes Discography = $170.
2022.01.16 18:50 svanapps Walmart Pivoting to Metaverse with Promises of NFTs, Cryptocurrency
|submitted by svanapps to CryptoToFuture [link] [comments]|
2022.01.16 18:50 squattersrights25 What is the CodeNames clue you would give for “tail” and “genius”?
2022.01.16 18:50 TheBeardedCocaire Sadly the Pandemic Finally Impacted my Job and Income. Selling Some of My Collection. All Unopened and Fontaines all Come in Plastic Sleeves. Please Let Me Know if You Have Questions or More Pictures.
|submitted by TheBeardedCocaire to PlayingCardsMarket [link] [comments]|
2022.01.16 18:50 the_internet_is_bad I hate the upvote-centered internet.
I hate this site. I hate social media. It's all about whatever "takes off." Yeah, you have options to look at your newest posts first but obviously very few people use it. Not even my actual friends see what I post on social media because it's buried under the hottest of takes. Nobody sees my posts here if a subreddit has a marginally large audience because my posts aren't hot topics. I miss when people populated forums that were new-post-centric by default, but also were often not so user-saturated you couldn't have a sense of community.
submitted by the_internet_is_bad to Vent [link] [comments]
2022.01.16 18:50 Trick-Net9889 send heLp! I just got PWJS but idk it will better maximize my xiao's potential vs my OG blackcliff. Which build should I go for?
2022.01.16 18:50 toomanyoars A slow death for both
I am married to BPD. That's not a typo. Most days anymore I feel like I am not married to the man I loved I am married to the pain and anguish of the disease he carries with him every minute of every day. I don't minimize the pain he's in but sadly I wish sometimes I had the denial he has. I step on a bug I feel a smidgen on guilt where as he looses it and tells me to kill myself as part of another screaming meltdown because I asked him to help me carry a heavy laundry basket and he thought I looked at him funny and an hour later is asking what's for dinner like nothing happened. It's hell almost every day and he is medicated when he takes them and makes excuses for not attending counseling. The one time we went together I thought we were going to die on the way him because I was being too quiet and he was so aggressive and volatile he kept swerving. I try to walk on eggshells every day but I can't ever say anything that has to do with him, ask anything of him and constantly be aware of my facial expressions. I am not looking for pity. I am however looking for insight. Help me understand and maybe pray for some peace for all of us because this is hell.
submitted by toomanyoars to BorderlinePDisorder [link] [comments]
2022.01.16 18:50 bee4534 If you send audio to an AR receiver via bluetooth from Epson Home Cinema 3200 4K, would it be considerably worse audio quality than eARC HDMI to a tv?
2022.01.16 18:50 burrito_knight HELPP
2022.01.16 18:50 BreakfastOk123 What are some good delivery places that are NOT on/promoted on delivery apps?
I feel like the feed has really curtailed my delivery experience recently. What are some places that aren't on the apps or don't promote there?
For example, just learned about Zen Yai. Even though I live a mile from it, and regularly search for new places, I have never seen it on DoorDash. I guess they don't pay DoorDash enough to get ranked highly in my searches.
submitted by BreakfastOk123 to sanfrancisco [link] [comments]
2022.01.16 18:50 CoachPop121 Yeah thanks Cheri….
|submitted by CoachPop121 to AnimalCrossing [link] [comments]|
2022.01.16 18:50 Tarmiracle Are modern day steroid treatments for crohns different from early 2000s steroid treatments (side effect wise)?
I (24f) was diagnosed with crohns around 2006 when I was in 5th grade. Had to get on prednisone (a steroid) and mannnn… I had a hard time with symptoms. Mainly I just blew up like a balloon, huge chubby cheeks that looked unnatural/swollen. Just full childhood embarrassment and trauma tbh.
Now, in my 20s I’m having some issues with my crohns and my new doctor is talking about possibly getting me back on a steroid. We have a few steps to take before moving forward with that so he hasn’t specified what steroid yet.
So y’all… is this going to be like my 5th grade experience all over again with the huge, obvious side effects? Did you have drastic face and feature changes as a result? I’ve heard in passing that modern steroids are a bit different than they were years ago but curious to the communities experiences.
Ultimately, just here to soothe some anxiety/childhood trauma trigger.
submitted by Tarmiracle to CrohnsDisease [link] [comments]
2022.01.16 18:50 CerebralCortexismine A selection of Zucker's outfits. Which is your favorite? 🤣 He's my resident fashionista.
|submitted by CerebralCortexismine to AnimalCrossingNewHor [link] [comments]|
2022.01.16 18:50 justabadthrowaway69 35/33 [MF4M] [MF4F] [MF4MF] Adventurous Partners Seeking Something… More.
This post might be a lot, so please bear with me (M) here.
I am in an incredibly lucky situation where my partner (33F) is not only open, but excited about the prospect of a threesome.
We are both open minded and looking to do a bit of experimenting. While we are both switch, we tend to vary depending on the situation.
Looking for F: She is looking for someone who enjoys touching, kissing, and sharing to join us and have a little bit of fun.
Looking for M: He will be sharing her with you (another man) and allowing her to be fucked by someone else while he is present and in control. Obviously looking for bi leaning males as some contact might be made.
I will be accepting the inquiries and the two of us will do some light screening (please no psychopaths). We cannot host but we can/will travel.
Her: Small frame, very fit. Short, petite with perky breasts and a tight ass. Amazing lips and great at sucking cock. Him: Average height and weight. Tattooed, well hung (8 inches), with a nice ass and great at giving instruction. If this is something you’re interested drop us a line with the following information (messages without this information will be ignored) :
a picture, your vaccination status (we are both vaccinated), the last 3 records you listened to, & your kinks/limits.
Not sure of a time frame in which we are trying to do this, just kind of playing it by ear. Look forward to talking to you.
submitted by justabadthrowaway69 to LasVegasr4r [link] [comments]
2022.01.16 18:50 MrsOni Mario drowned right after I reached the surface
|submitted by MrsOni to Wellthatsucks [link] [comments]|
2022.01.16 18:50 powerhouseofthiscell How do you tell a person you dont want their random gifts?
2022.01.16 18:50 MemeReserveBot Or guns, or being fat, or existing (by Critical_Attitude210 January 16, 2022 at 05:06AM)
|submitted by MemeReserveBot to MemeReserve [link] [comments]|
2022.01.16 18:50 YouVision TAKING CARE OF THE DEVIL
2022.01.16 18:50 jobsinanywhere Newcastle want former Man Utd and Chelsea supremo Peter Kenyon as new CEO after Saudi takeover
2022.01.16 18:50 charliej0432 Special interests
I was wondering if anyone has the same interests as I do and would like to talk about them? I don't know anyone else who likes the same things as me. They are musical theatre and London transport (specifically the underground trains) If anyone likes these and would like to talk then feel free to message me!
submitted by charliej0432 to AutismTranslated [link] [comments]
2022.01.16 18:50 Hiko_Seijuro92 FLAKING (Short experience)
Let's tall about a recent experience ( 1 month ago ) when invited to drink to a company event . It was a Friday night and I went with a friend to a bar to meet other people on my company and to socialise a bit .
There it seemed that some women found me interesting and I started to discuss with her ..etc Later on the night , we went on a dancing bar / club and I noticed that there was another girl with us more attractive who was interesting by me . I kind of stopped flirting /teasing the first one to switch to the other one .We danced and almost kissed but nothing happened because some guys we known started to do some watch over us
One week later I took her number and started to text her to organise a date ..etc Despite being very interesting , she was kind of cancelling always with an excuse but vaguely rescheduling . Along the 2 next week , the excuses were so ridiculous like " Sorry I did not respond because I was busy ... but yeah i really want to go for a date " the last one being :
-Let's see each other this afternoon ( the girl at 09:00 AM ) - At what time will you be available ( me ) - Sorry my mobile phone turned off because of the cold and I could not respond you during the day " ( the girl at 08:00 PM )
I never responded to her again and I deleted her number . Yet let me tell you something about that girl . She really looked interested and looked nice by her words but the actions show something different.
What do you think of that ?
submitted by Hiko_Seijuro92 to seduction [link] [comments]