Two numbers which sums up to k #dailycode #dailycoding #codingchallenge #codingchallenges

preview_player
Показать описание
Check if there exists two numbers located in different indices which sums up to a given sum

FYI, this problem was recently asked by Google.

Algorithms used: Sorting + Two pointers
Time Complexity (TC): O(n • log(n) + n)
---》O(n • log(n))
Space Complexity (SC): O(1)

Fun fact:
There's an O(n) solution to this problem!
Check out my previous video:

If you have any questions, don't hesitate and feel free to ask.

In case you want me to make a video about a certain topic, feel free to tell me in the comments.

#programming
#coding
#algorithms
#algorithm
#algorithmhacks
#algorithmhack
#algorithmicthinking
#algorithmicdesign
#algorithmoptimization
#algorithmanalysis
#algorithmdevelopment
#algorithmmastery
#datastructures
#datastructure
#datastructureandalgorithms
#datastructureandalgorithm
#dsallvideos
#dsalgo
#dsa
#codingchallenges
#codingchallenge
#codinginterview
#codinginterviews
#codinginterviewquestions
#competitiveprogramming
#programmer
#programmers
#coder
#coders
#developer
#developers
#softwaredev
#softwaredeveloper
#softwaredevelopers
#softwaredevelopment
#softwareengineer
#softwareengineers
#softwareengineering
#arrays
#array
#sort
#sorting
#sortingalgorithms
#sortingalgorithm
#twopointers
#optimization
#optimized
#optimize
#optimizationtechniques
#efficiency
#efficient
#dailycode
#dailycoding
#techcompany
#bigtech
#bigtechs
#faang
#faangpreparation
#faangcodinginterviewpreparation
#google
#googleinterview
Рекомендации по теме
Комментарии
Автор

Sort has NlogN complexity.
This task can be solved with linear (N) complexity.

EternalSearcher
join shbcf.ru