← All problemsSign in

Query Problem

### Problem Statement You are given a Q queries, each of the query will be one of these types 1. L X - "L" means you need to append X left of the list 2. R X - "R" means you need to append X right of the list 3. ? X - You need to find the minimum steps to reach X from either left side of the list or right side of the list ( for better understanding please go through the exaple explanation )

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start