DEV Community
•
2026-03-22 04:51
Kth Smallest Element in an Array (Python)
Problem Statement
Given an array arr[] and an integer k, find the kth smallest element in the array.
The kth smallest element is based on the sorted order of the array.
Examples
Input: arr = [10, 5, 4, 3, 48, 6, 2, 33, 53, 10], k = 4
Output: 5
Input: arr = [7, 10, 4, 3, 20, 15], k = 3
Output: 7
Objective
• Sort the array (or logically determine order)
• Return the element at position k-...