Pergunta de entrevista da empresa Sagemcom

Write a function in your preferred programming language that takes in a string as input and returns the number of occurrences of each character in the string. Ignore spaces and consider uppercase and lowercase letters as the same character. For example, given the input: "Hello World", the function should return: {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}.