prepare('SELECT * FROM challenges WHERE id = ? AND deleted_at IS NULL'); $stmt->execute([$challenge_id]); $challenge = $stmt->fetch(); if (!$challenge) { header('Location: challenges.php'); exit(); } $user_id = $_SESSION['user_id'] ?? null; $submissions = []; if ($user_id) { $stmt = $pdo->prepare('SELECT * FROM challenge_submissions WHERE user_id = ? AND challenge_id = ? ORDER BY submitted_at DESC'); $stmt->execute([$user_id, $challenge_id]); $submissions = $stmt->fetchAll(); } ?>
Submit Your Solution

Difficulty: | Learning Style:


Description

Sample Cases

Input:\n" . htmlspecialchars($sample['input']) . "\n";
                                    echo "Output:\n" . htmlspecialchars($sample['output']) . "\n\n";
                                }
                            ?>

My Submissions

0) : ?>
Attempt Language Status Date
You have not made any submissions for this challenge yet.