Symmetric Difference

Medium Sets PRO
🔒 Login to Unlock

Problem Statement

Write a Python program to find the symmetric difference between two sets (elements present in either set, but not in both) and print them sorted as a list.

Input Format

Line 1: First set elements. Line 2: Second set elements.

Output Format

Print the sorted symmetric difference elements as a list.

Constraints

Valid elements

Sample Input

1 2 3
3 4 5

Sample Output

['1', '2', '4', '5']

Explanation

Symmetric difference uses the `^` operator or `.symmetric_difference()`.

Starter Code

def set_sym_diff(s1, s2):
    # Write your code here
    pass

s1 = set(input().split())
s2 = set(input().split())
print(sorted(list(set_sym_diff(s1, s2))))

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used