Skip to content
DATA STRUCTURE
DATA STRUCTURE

Learn everything about Data structures.

  • Algorithms
  • DSA
  • Array
  • Stack
  • Queue
  • Matrix
  • Programs
DATA STRUCTURE

Learn everything about Data structures.

HackeRank Array – DS solution in Python

YASH PAL, May 13, 2025May 21, 2025

Today we are going to solve HackerRank Array – DS problem in Python programming with step by step practical program code example.

An array is a data structure that stores elements of the same type in a contiguous block of memory. In an array, A, of size N, each memory location has some unique index, (where 0 <= i < N ), that can be referenced as A[i] or Ai.

Your task is to reverse an array of integers.

HackeRank Array DS problem solution in Python
Array DS

Problem solution in Python

n = int(input())
li = list(input().split())
li.reverse()
print(' '.join(li))

Second solution in Python 2

# Enter your code here. Read input from STDIN. Print output to STDOUT
n=int(raw_input())
l=raw_input().split()
rl= l[::-1]
print ' '.join(rl)

Other solutions – HackerRank 2D Array DS problem solution in Python

Also read – Array in Data Structure

data structures arraysprograms

Post navigation

Previous post
Next post
  • HackerRank Dynamic Array Solution in Python
  • HackerRank 2D Array DS solution in Python
  • HackeRank Array – DS solution in Python
  • Streaming Demystified: How Much Data Does Your Favorite Show Really Use?
  • Parenthesis Matching program in C programming
  • HackerRank Dynamic Array Solution in Python
  • HackerRank 2D Array DS solution in Python
  • HackeRank Array – DS solution in Python
  • Streaming Demystified: How Much Data Does Your Favorite Show Really Use?
  • Parenthesis Matching program in C programming
  • About US
  • Contact US
  • Data Structures and algorithms tutorials
  • Digital Communication Tutorials
  • DMCA
  • HackerRank All Algorithms problems solutions
  • HackerRank C problems solutions
  • HackerRank C++ problems solutions
  • HackerRank Java solutions
  • HackerRank Python solutions
  • Human Values Tutorials
  • Internet of Things Tutorials
  • Privacy Policy
©2025 DATA STRUCTURE | WordPress Theme by SuperbThemes