Competitive Programming with Python | Core Techniques Two Pointer Approach

preview_player
Показать описание
Title: Core Techniques Two Pointer Approach
Description: Two pointer approach to check if a string is a palindrome and find target value in a sorted array.
The graph: may contain negative edges but no negative cycles

#CompetitiveProgramming #ProgrammingKnowledge #TwoPointersTechnique #FloydWarshall #TopologicalSort #DijkstrasAlgorithm #NumberTheory #Python #Sieve #BitMagic #algorithm
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Рекомендации по теме
Комментарии
Автор

Thanks a lot man such a simple yet effective illustration

Mrnobody.
Автор

In palindrome without loop, we can also directly do return s == s[::-1]

raghavagrawal
Автор

for palindrome, just do
for _ in range(int(input())):
s = list(input())
a = s.copy()
a.reverse()
print("True" if a == s else "False")

andrewlee
Автор

isn't this just checking if the first and last letters match?

This method will return True for words like: "Henryh", or "pinep"

odnanref
join shbcf.ru