Implement the function count_unique_substrings_in_pile(pile, B) in a file called /app/solution.py. This function should perform the following functionality:
Generate all substrings of a given string B:
From the string B, create a list of all possible substrings.
Remove duplicate substrings:
Ensure that only unique substrings are kept by converting the list of substrings to a set and then back to a list.
Count unique substrings present in another string pile:
Iterate through the list of unique substrings and count how many of these substrings are found within the string pile.
Input Requirements:
The function takes two parameters:
pile (str): A string that may contain some substrings which are generated from B.
B (str): A string from which all possible substrings will be generated.
Output Requirements:
The function should return an integer representing the count of unique substrings of B that are present in the pile.
Example:
python
count_unique_substrings_in_pile("abcdef", "abc")
# Returns: 3 (substrings "a", "ab", "abc" are in the pile)
count_unique_substrings_in_pile("xyz", "hello")
# Returns: 0 (no substrings are found in the pile)
Implement the above logic adhering to the specified input and output requirements in /app/solution.py.