- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Prime List Problem solved in JS | GeeksforGeeks | POTD | Streak 154 | Sat, 03 May 2025 | NCS
You are given the head of a linked list. You have to replace all the values of the nodes with the nearest prime number. If more than one prime number exists at an equal distance, choose the smallest one. Return the head of the modified linked list.
Examples :
Input: head = 2 → 6 → 10
Output: 2 → 5 → 11
Explanation: The nearest prime of 2 is 2 itself. The nearest primes of 6 are 5 and 7, since 5 is smaller so, 5 will be chosen. The nearest prime of 10 is 11.
Input: head = 1 → 15 → 20
Output: 2 → 13 → 19
Explanation: The nearest prime of 1 is 2. The nearest primes of 15 are 13 and 17, since 13 is smaller so, 13 will be chosen. The nearest prime of 20 is 19.
---
introduction:
name: "Jagadeesh Kumar S"
contact: "+91 73972 85837 | 33x23@pm.me"
description: "A problem-solving enthusiast passionate about coding challenges."
technical_achievements:
- "Solved 100+ daily coding challenges on GeeksforGeeks"
- "Ranked in the top 130 on SRM Institute of Science and Technology's GeeksforGeeks leaderboard"
- "Maintained a 100+ day streak for Problem of the Day"
github:
contributions: "Solutions available at https://github.com/JKS-sys/Solution-To-Problem-Of-The-Day-at-geeksforgeeks.org"
---
Видео Prime List Problem solved in JS | GeeksforGeeks | POTD | Streak 154 | Sat, 03 May 2025 | NCS канала NewsCraft Studio (by JKS)
Examples :
Input: head = 2 → 6 → 10
Output: 2 → 5 → 11
Explanation: The nearest prime of 2 is 2 itself. The nearest primes of 6 are 5 and 7, since 5 is smaller so, 5 will be chosen. The nearest prime of 10 is 11.
Input: head = 1 → 15 → 20
Output: 2 → 13 → 19
Explanation: The nearest prime of 1 is 2. The nearest primes of 15 are 13 and 17, since 13 is smaller so, 13 will be chosen. The nearest prime of 20 is 19.
---
introduction:
name: "Jagadeesh Kumar S"
contact: "+91 73972 85837 | 33x23@pm.me"
description: "A problem-solving enthusiast passionate about coding challenges."
technical_achievements:
- "Solved 100+ daily coding challenges on GeeksforGeeks"
- "Ranked in the top 130 on SRM Institute of Science and Technology's GeeksforGeeks leaderboard"
- "Maintained a 100+ day streak for Problem of the Day"
github:
contributions: "Solutions available at https://github.com/JKS-sys/Solution-To-Problem-Of-The-Day-at-geeksforgeeks.org"
---
Видео Prime List Problem solved in JS | GeeksforGeeks | POTD | Streak 154 | Sat, 03 May 2025 | NCS канала NewsCraft Studio (by JKS)
GeeksforGeeks POTD Solution JavaScript Coding Interview Algorithm Optimization Scheduling Problems Dynamic Programming Coding Challenges Problem Solving Tech Interview Prep GeeksforGeeks Problem of the Day Solution JavaScript Coding Interviews Optimizing Algorithms Dynamic Programming Concepts Data Structures Algorithms JavaScript
Комментарии отсутствуют
Информация о видео
3 мая 2025 г. 6:40:15
00:01:42
Другие видео канала





















