Given an undirected graph where all edges initially have weight 1, you need to find the shortest path from a source node to all other nodes. However, there's a special constraint: any edge that connects to a designated 'special node' V has its weight reduced to 0 instead of 1.
You need to implement the function solution that takes a graph and a source node and returns the shortest distances from the source node to all other nodes, considering the given constraints.
An array of size N where result[i] represents the shortest distance from the source node to node (i+1). If a node is unreachable, return -1 for that position.
Return a single line containing a space-separated list of integers, where each integer at index i represents the shortest distance from the source node to node i+1 (1-indexed). If a node is unreachable, return -1 for that node.