OpenAI Online Assessment: Count Colorful Paths

OpenAI Online Assessment 2026

You are given an undirected graph with n nodes. colors[i] is the color of node i, an integer from 0 to 3. edges[j] = [a, b] means there is an edge between nodes a and b.

A colorful path is a sequence of 4 distinct nodes, one of each color, where every two consecutive nodes are connected by an edge.

Return the number of colorful paths. The same 4 nodes in a different order count as different paths...

OpenAI Online Assessment Count Colorful Paths

OpenAI Crash Course

Fullset Newest OpenAI Coding/System Design Questions, Optimal Solutions and Explanations.

Step_1 Matched with a FAANG+ Senior Engineer

Step_2 Fullset OpenAI Coding/System Design Questions

Step_3 Solutions + step by step Explanation

Check it out